<?$this->_extends("_layouts/main_layout");?>

<?$this->_block("contents");?>

<script type="text/javascript">
<!--
function isdelete(can){
	if (can) {
		return confirm("确定要删除该用户组？");
	}
	alert("该用户组下有用户，不能删除该用户组，请删除该用户组下所有用户后进行该操作！");
	return false;
}
//-->
</script>
<?php if (hp('group.2')) {?>
<input type="button" class="btn1" value="添加"  onclick="window.location.href='<?php echo url('group/create');?>';" style="width:80px;"/>
<?php }?>
<br>
<table class="list_table" width="100%" cellpadding="0" cellspacing="0">
	
	<tr>
		<th width="">序号</th>
		<th width="">用户组</th>
		<?php if (hp('group.3')||hp('group.4')) {?>
		<th width="" >操作</th>
        <?php }?>
        <?php if (hp('group.3')) {?>
		<?php }?>
	</tr>
	<?php 
		$groupid_teacher = Q::ini('appini/groupid_teacher');
		$groupid_user = Q::ini('appini/groupid_user');
		$groupid_eduspot = Q::ini('appini/groupid_eduspot');
	?>
<?php foreach ($list as $i=>$row) {$can = $row->can_delete;?>
	<tr>
		<td><?=$i+$start+1?></td>
		<td><?=$row['groupname']?></td>
		<?php if (hp('group.3')||hp('group.4')) {?>
		<td><?php if (hp('group.3')) {?><a href="<?=url('group/edit', array('id'=>$row['id']))?>" style="color:blue" title="修改">[修改]</a><?php }?> 
      	<?php if (hp('group.4')) {?>
        	<?php if($row['id'] != $groupid_teacher && $row['id'] != $groupid_user && $row['id'] != $groupid_eduspot){?>
            	<a href="<?=url('group/delete', array('id'=>$row['id']))?>" onclick="return isdelete(<?php echo $can;?>);" style="color:blue" title="删除">[删除]</a>
			<?php }?>
      	<?php }?>
    </td>
        <?php }?>
		
	</tr>
	
<?}?>

</table><br>
<?php $this->_control("pagination", "", array('pagination'=>$pager));?>


<?php $this->_endblock();?>
